import { get } from '@/utils/http'
import { post } from '@/utils/http'
import { del } from '@/utils/http'
import { put } from '@/utils/http'
import {patch} from '@/utils/http'

export const getRoomsApi = (page=1,pagesize=5,number='') =>get(`house?page=${page}&pagesize=${pagesize}&number=`+number)
export const getRoomsKind = () =>get('hotel/r_kind')
export const checkRoomsApi = r_name =>get('/house/exist',{params: {r_name}})
export const delRoomApi = data => del('/house/'+data)
export const addRoomApi = data => post('/house',data)
export const addSettingApi = data => post('/hotel/addsetting',data)
export const addHouseApi = data => post('/hotel/addhouse',data)
export const addUserApi = data => post('/hotel/adduser',data)
export const getPassApi = data => post('/hotel/password',data)
export const patchRoomApi = data => patch('/house',[data]) //传的是数组，最后一个是1，或者0
export const putRoomApi = (number,data) => put('/house/'+number,data)
export const removeRoomApi = data => post('/house/room',[data])
export const getCity = () =>get('hotel/city')